<?php

if(!class_exists("Configuracion")) include_once "classes/class.Config.php";
$cfg = new config();

if (!class_exists("DataBase")) include_once $cfg->pathClasses."/class.DataBase.php";
$bd = new DataBase();

$codigo_actvacion = $_GET['c'];
$idUser           = $_GET['id'];  

if (!$bd->activarUsuario($idUser,$codigo_activacion)) {
    $error = true;
    $html  = "Ha habido un error al activar el usuario";
}else {
    $error = false;
    $html  = "Su cuenta de usuario ha sido activada, inicie sesion.";
}

?>

<head>
    
        <title>ElectrolinerasOnline.com</title>         

        <!-- META -->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=8">

        <!-- CSS -->
        <link rel="stylesheet" type="text/css" media="all" href="<?php echo $cfg->pathCss ?>/main2.css"/>      
        <link href='http://fonts.googleapis.com/css?family=Nunito:300' rel='stylesheet' type='text/css'> <!-- 'Nunito', sans-serif; -->
        <link href='http://fonts.googleapis.com/css?family=Convergence' rel='stylesheet' type='text/css'> <!-- 'Convergence', sans-serif; -->
        <link type="text/css" href="<?php echo $cfg->pathJs ?>/jqueryui/css/custom-theme/jquery-ui-1.8.17.custom.css" rel="stylesheet" />	
    <!--    <link type="text/css" href="<?php echo $cfg->pathJs ?>/DropKick/dropkick.css" rel="stylesheet" />	-->
    <!--    <link type="text/css" href="<?php echo $cfg->pathJs ?>/DropKick/example/example.css" rel="stylesheet" />	-->
        <link type="text/css" href="<?php echo $cfg->pathCss ?>/ezmark.css" rel="stylesheet" />	
        <link rel="stylesheet" href="<?php echo $cfg->pathJs ?>/fancybox/source/jquery.fancybox.css?v=2.0.5" type="text/css" media="screen" />
        <link rel="stylesheet" href="<?php echo $cfg->pathJs ?>/fancybox/source/helpers/jquery.fancybox-buttons.css?v=2.0.5" type="text/css" media="screen" />
        <link rel="stylesheet" href="<?php echo $cfg->pathJs ?>/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.5" type="text/css" media="screen" />

        <!-- SCRIPTS -->
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/jqueryui/js/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/jqueryui/js/jquery-ui-1.8.17.custom.min.js"></script>
        <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/common.js"></script>
    <!--    <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/DropKick/jquery.dropkick-1.0.0.js"></script>-->
        <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/jquery.ezmark.min.js"></script>
        <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/fancybox/source/jquery.fancybox.pack.js?v=2.0.5"></script>
        <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"/></script>
        <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/fancybox/source/helpers/jquery.fancybox-buttons.js?v=2.0.5"></script>
        <script type="text/javascript" src="<?php echo $cfg->pathJs ?>/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.5"></script>
        
        <script>
                $(document).ready(function (){
                        $("input#btn_login").button();

                        $("input#btn_login").click( function () { 
                                                        document.login_form.submit() 
                                                    } );
                 });
        </script>
        
</head>

<div id="contenedor" class='container'>
 
    <?php  include $cfg->pathRaiz."/header2.php";    ?>
            
    <div id="cuerpo" class="clear">
        
            <p style="margin-top: 100px;">
                <?php  
                    if ($error) echo $cfg->getMessageBox($html,'90%'); 
                    else        echo $cfg->getMessageBox($html,"90%");            

                ?>
            </p>
            
            <?php if (!$error) { ?>
            
                    <div id="login">
                            <h2>Inicia sesion </h2>
                            <form name="login_form" method="POST" action="<?php echo $cfg->pathConfig.'/sesion.php?m=iniciar' ?>">
                                    <table id="add_user_simple" class="borded-table" border="0">
                                    <tr>
                                        <td style="text-align:left">
                                            Mail<br>
                                            <input name="mail" type="text" maxlength="50" value="djmasakre@gmail.com"/>
                                        </td> 
                                    </tr> 
                                    <tr>
                                        <td  style="text-align:left">
                                            Password<br>
                                            <input name="password" type="password" maxlength="50" value="thund3rfuck"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <input type="button" value="Inicia" id="btn_login" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"/>
                                        </td>
                                    </tr>
                                    </table>
                            </form>    
                    </div>
    
            <?php }  ?>    
       
    </div>
    
</div>
        
        
        
     
           
  

